package only.my.railgunys.artifact;

import only.my.railgunys.bean.Character;
import org.springframework.beans.BeanUtils;

public class MainStatRoll {
    String position;
    ArtifactBonusEffectiveCheck effectiveCheck;

    MainArtifactBonus enhanceFunction;

    public MainStatRoll(String position, ArtifactBonusEffectiveCheck effectiveCheck, MainArtifactBonus enhanceFunction){
        this.position = position;
        this.effectiveCheck = effectiveCheck;
        this.enhanceFunction = enhanceFunction;
    }
    public MainStatRoll(String position, MainArtifactBonus enhanceFunction){
        this.position = position;
        this.enhanceFunction = enhanceFunction;
    }
    public Character enhanceCharacter(Character character,MainArtifactStatType mainType){
        Character character0 = new Character();
        boolean isBonusEffective = effectiveCheck.bonusEffectiveCheck(character);
        if(!isBonusEffective){
            return  null ;
        }
        BeanUtils.copyProperties(character,character0);
        enhanceFunction.artifactBonus(character0,mainType);
        character0.addDescription(position);

        return character0;
    }

}
